//存放所有api
import { get, post, put } from '@/utils/axios'

// 登录页面请求
export const login = (params) => post("/user/login", params);

// 获取轮播图
export const getSwiper = () => get("/banner/list");

//地址页面请求
export const  getAddress = (params) => get('/address/list', params)

// 地址增加请求
export const addAddress = (params) => post('/address/addlist' ,params)

//删除地址
export const delAddress = (params) => post('/address/dellist' ,params)

//修改地址信息
export const editAddress = (params) => post('/address/altlist' ,params)



export const getCategoryList = (params) => get('/pro/categorylist', params)




// 请求订单列表
export const getOrderList =(params)=>get('order/list',params)

// 取消订单接口
export const editOrder=(params)=>post('order/altList',params)

// 获取商品列表
export const getGoodsList = params =>get('pro/goodslist',params)

// 获取购物车列表
export const getCartList = params =>get('cart/list',params)

// 加入购物车
export const addCart = (params) => post('cart/addlist', params)

// 删除购物车
export const delCart = (params) => post('cart/dellist', params)

// 批量删除购物车
export const delCartList = (params) => post('cart/delAllList', params)

// 修改购物车数量
export const changeCartNum = (params) => post('cart/altListNum', params)

// 修改购物车单个商品选中状态
export const changeCartFlag = (params) => post('cart/altList', params)

//增加订单信息
export const Addorder = (params) => post('order/addList', params)



//请求优惠券种类
export const getCoupon = (params) => get('/coupon/getCoupon',params)

//请求该用户拥有几张优惠券
export const getUserCoupon = (params) => get('/coupon/getUserCoupon', params)

//用户购买的优惠券接口
export const addCoupon = (params) => post('/coupon/addCoupon', params)

// 用户使用红包
export const useUserCoupon = (params) => post('/coupon/useUserCoupon', params)

// 获取店铺信息
export const getshopAddress = (params) => get('/storeAddress/getAddress', params)
// 增加店铺信息
export const addStore = (params) => post('/storeAddress/addStoreAddress' ,params)

// 使用咖啡钱包
export const useWallet = (params) => get('/coupon/getUserCoupon', params)